﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace JAAF.UI.WPF
{
    /// <summary>
    /// Interaction logic for TaskButton.xaml
    /// </summary>
    public partial class TaskButton : UserControl
    {
        private Button m_btn;


        public static DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(TaskButton));
        public static DependencyProperty DocumentationProperty = DependencyProperty.Register("Documentation", typeof(string), typeof(TaskButton));
        public static DependencyProperty ImageSourceProperty = DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(TaskButton));
        public static DependencyProperty CommandProperty = DependencyProperty.Register("Command", typeof(ICommand), typeof(TaskButton));

        public TaskButton()
        {
            InitializeComponent();
            //m_btn = (Button)this.Content;

        }

        public ICommand Command
        {
            get
            {
                return (ICommand)base.GetValue(CommandProperty);
            }

            set
            {
                base.SetValue(CommandProperty, value);
            }
        }

        public string Text
        {
            get
            {
                return (string)base.GetValue(TextProperty);
            }

            set
            {
                base.SetValue(TextProperty, value);
            }
        }

        public string Documentation
        {
            get
            {
                return (string)base.GetValue(DocumentationProperty);
            }

            set
            {
                base.SetValue(DocumentationProperty, value);
            }
        }


        public ImageSource ImageSource
        {
            get
            {
                return (ImageSource)base.GetValue(ImageSourceProperty);
            }

            set
            {
                base.SetValue(ImageSourceProperty, value);
            }
        }
        


        //protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        //{
        //    if (e.Property == CommandProperty)
        //    {
        //        m_btn.Command = (ICommand)e.NewValue;
        //    }
        //    else
        //    {
        //        base.OnPropertyChanged(e);
        //    }
        //}
    }
}
